<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 使用Set实现数组去重
    var arr = [1, 3, 4, 5, 2, 4, 2, 5, 45, 3, 2, 4, 1, 5, 6, 8, 9, 5, 3];
    const b = Array.from(new Set(arr));
    const c = [...new Set(arr)];
    console.log(arr);
    console.log(c);

  </script>
</body>

</html>